package 差分;/**
 * @author： li
 * @date： 2022-04-03 19:40
 * @version 1.0
 */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;


public class 小明的彩灯1 {
    public static void main(String[] args) throws IOException {
        int n,q;
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        in.nextToken();
        n = (int) in.nval;
        in.nextToken();
        q = (int) in.nval;
        long[] a = new long[500010];
        long[] b = new long[500010];
        for(int i=1; i<=n; i++) {
            in.nextToken();
            a[i] = (long) in.nval;
            b[i] = a[i] - a[i-1];
        }
        int l,r;
        long x;
        for(int i=0; i<q; i++) {
            in.nextToken();
            l = (int) in.nval;
            in.nextToken();
            r = (int) in.nval;
            in.nextToken();
            x = (long) in.nval;
            b[l] += x;
            b[r+1] -= x;
        }

        for(int i=1; i<=n; i++) {
            b[i]+= b[i-1];
            if(b[i]<0)
                System.out.print(0+" ");
            else
            System.out.print(b[i]+" ");
        }

    }
}
